package com.example.demo.mapper;

import com.example.demo.entity.Order;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface OrderMapper {
    public Order findById(Long id);
    public List<Order> findAllOrderByUserId(Long userId,Integer index,Integer limit);
    public List<Order> findUserOrderByMenuName(Long userId, String menuName, Integer index, Integer limit);
    public Integer createOrder(Order order);
    public Integer confirmOrder(Long orderId);//状态改为已完成3
    public Integer payOrder(Long orderId);//状态改为已支付1
    public Integer deliverOrder(Long orderId);//状态改为已发货2
    public Integer deleteOrder(Long orderId);
    public Boolean isDelete(Long orderId);//订单是否是被删除状态true是已被删除
    public List<Order> findAllOrder(Integer index,Integer limit);
    public List<Order> findAllByMenuName(String menuName,Integer index,Integer limit);
    public List<Order> findAllByTelephone(String telephone,Integer index,Integer limit);
    public List<Order> findAllByUserName(String userName,Integer index,Integer limit);
    public Boolean existOrder(Long orderId);
}
